Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
:confused: I'd be really grateful of knowing the code to call the external Interface function via JavaScript, from an HTML link in DW cs3, to play timeline of swfobject – not resulting in the flash movieclip disapearing or the ScrollTo.js query from failing!
I am hoping the solution is fairly simple to control the timeline of the only embedded swfobject using ActionScript3 - gotoAndplay ("lable") command...
As you can see from the code I am using, the defining bits are missing!
Any help would really go along way to meeting my deadline.


**JavaScript** – to call Flash event from HTML button link, placed between head tags


function callExternalInterface()
var flashMovie = window.document.menu;
flashMovie.menu_up(value);


menu_up is the string


**HTML**

<div id="btn_up"><a href="#top" name="charDev" id="charDev" onclick="">top</a></div>


The pane navigation div uses ScrollTo.js query, and it is through this link I need calling back to the embedded "menubtns.swf" (nested in "AS3Menu_javascript.swf") *to play 5 frames* of this movieclip, via a JS function:~.
Below, is the embedded .swf code, using swfobject.js with allowScriptAccess=always set.

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="menu" width="251" height="251" id="menu">
    <param name="movie" value="../~Assets/Flash/AS3Menu_javascript.swf" />
    <param name="allowScriptAccess" value="always" />  
    <param name="movie" value="ExternalInterfaceScript.swf" />
    <param name="quality" value="high" />
    <object type="application/x-shockwave-flash" data="../~Assets/Flash/AS3Menu_javascript.swf" width="250" height="250">
    <p>Alternative content</p>
    </object>
</object>



**AS3 / Flash**

import flash.external.ExternalInterface;flash.system.Security.allowDomain(/sourceDomain/);

ExternalInterface.addCallBack("menu_up", this, resetmenu);
function resetmenu(){
gotoAndPlay:("up")
Posted
Updated 3-Jun-10 11:24am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900